import {addObj,getdata} from '../../../api/finance-manage-bill'

export default {
    name: "index",
    data(){
        return{
            form:{
                contributionSet:"",
                overdueSet:"",
                callSet:""
            }
        }
    },
    created(){
        this.getListData()
    },
    methods:{
        getListData(){
            getdata().then(resp => {
                this.form=resp.data.data
                // console.log(resp.data.data)
            })
        },
        saveData(){
            this.$refs.dataForm.validate(valid => {
                if (valid) {
                    addObj(this.form).then(response=>{
                        if(response.data.data){
                            this.suc('添加成功')
                        }
                    })
                }
            })
        },
        handleContributionSetBulr(val) {
            const re = /^([1-9][0-9]*)$/
            if (!re.test(val)) {
                this.$message.error('请输入大于0且小于367的整数！')
                this.form.contributionSet = ''
            }
        },
        handleOverdueSetBulr(val) {
            const re = /^([1-9][0-9]*)$/
            if (!re.test(val)) {
                this.$message.error('请输入大于0且小于367的整数！')
                this.form.overdueSet = ''
            }
        },
        handleCallSetBulr(val) {
            const re = /^([1-9][0-9]*)$/
            if (!re.test(val)) {
                this.$message.error('请输入大于0且小于367的整数！')
                this.form.callSet = ''
            }
        }
    }
}
